package com.lineage.data.item_etcitem.quest;

import com.lineage.data.cmd.CreateNewItem;
import com.lineage.data.executor.ItemExecutor;
import com.lineage.server.model.Instance.L1ItemInstance;
import com.lineage.server.model.Instance.L1PcInstance;
import java.util.Random;

public class Bonusbox_11 extends ItemExecutor {
  private final Random _random = new Random();
  
  private final int[] bonus_list = new int[] { 
      56216, 56217, 56218, 56219, 56220, 56221, 56222, 56223, 56224, 56225, 
      56226, 
      56227, 56228, 56229, 56230, 56231, 56232, 56233, 49334, 49333, 
      49332, 49331, 49330, 49329, 49328, 49327, 
      56235, 49336 };
  
  public static ItemExecutor get() {
    return new Bonusbox_11();
  }
  
  public void execute(int[] data, L1PcInstance pc, L1ItemInstance item) {
    if (item == null)
      return; 
    if (pc == null)
      return; 
    pc.getInventory().removeItem(item, 1L);
    int value = this._random.nextInt(2) + 1;
    int i = 0;
    while (i < value) {
      CreateNewItem.createNewItem(pc, this.bonus_list[this._random.nextInt(this.bonus_list.length)], 1L);
      i++;
    } 
  }
}
